package com.zksk.admin.api;

import com.zksk.admin.api.domain.SysDictData;
import com.zksk.admin.api.factory.RemoteDictFallbackFactory;
import com.zksk.common.core.constant.SecurityConstants;
import com.zksk.common.core.constant.ServiceNameConstants;
import com.zksk.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;


@FeignClient(contextId = "remoteDictService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDictFallbackFactory.class)
public interface RemoteDictService {

    /**
     * 根据字典code查询值
     */
    @GetMapping(value = "/dict/data/type/{dictType}")
    public R<List<SysDictData>> getDictDataByCode(@PathVariable("dictType") String dictType,
                                                  @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
